package com.itheima.tilas.aop.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author 132
 */
public class EatInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        //调用父类方法
        System.out.println("找主人");
        proxy.invokeSuper(obj,args);
        System.out.println("唱跳一下");
        return obj;
    }
}
